/*
 * testerMergeSort.cpp
 *
 *  Created on: Sep 14, 2011
 *      Author: dgdiniz
 */

#include <iostream>
#include <stdio.h>
#include "sort/mergeSort.hpp"

using namespace std;



void    RunTestsMergeSort()
{
	int listToSortInt[10] = {5,3,9,7,1,2,6,8,4,0};
	string listToSortString[10] = {"Douglas", "Gisele", "casa", "maria", "amor", "moly", "Dream", "Loja", "carinho", "tudo"};

	cout << "Before Merge Sort:  ";
	for (int i=0; i<10; i++)
		cout << " | " << listToSortInt[i];

	cout << endl;

	mergeSort(&listToSortInt[0], 10);

	cout << "After Merge Sort:  ";
	for (int i=0; i<10; i++)
		cout << " | " << listToSortInt[i];

	cout << endl;



	cout << "\n\n\nBefore Merge Sort:  ";
	for (int i=0; i<10; i++)
		cout << " | " << listToSortString[i];

	cout << endl;

	mergeSort(&listToSortString[0], 10);

	cout << "After Merge Sort:  ";
	for (int i=0; i<10; i++)
		cout << " | " << listToSortString[i];

	cout << endl;



	cout << "\n\n\nBefore Merge Sort Dec:  ";
	for (int i=0; i<10; i++)
		cout << " | " << listToSortInt[i];

	cout << endl;

	mergeSortDec(&listToSortInt[0], 10);

	cout << "After Merge Sort Dec:  ";
	for (int i=0; i<10; i++)
		cout << " | " << listToSortInt[i];

	cout << endl;


}

void testerMergeSort()
{
	cout << "\n\n\n\nTESTER-MERGE-SORT ---  Testing Merge Sort\n";
	RunTestsMergeSort();
	cout << "TESTER-MERGE-SORT ---  FINISHED!\n\n\n\n";
}
